package com.binest.foreignInvest.service.impl;

import java.util.List;
import com.binest.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.binest.foreignInvest.mapper.ForeignInvestMapper;
import com.binest.foreignInvest.domain.ForeignInvest;
import com.binest.foreignInvest.service.IForeignInvestService;

/**
 * 对外投资Service业务层处理
 * 
 * @author wwd
 * @date 2024-01-24
 */
@Service
public class ForeignInvestServiceImpl implements IForeignInvestService 
{
    @Autowired
    private ForeignInvestMapper foreignInvestMapper;

    /**
     * 查询对外投资
     * 
     * @param id 对外投资主键
     * @return 对外投资
     */
    @Override
    public ForeignInvest selectForeignInvestById(String id)
    {
        return foreignInvestMapper.selectForeignInvestById(id);
    }

    @Override
    public List<ForeignInvest> selectForeignInvestListByInId(String inclousionId) {
        return foreignInvestMapper.selectForeignInvestListByInId(inclousionId);
    }

    /**
     * 查询对外投资列表
     * 
     * @param foreignInvest 对外投资
     * @return 对外投资
     */
    @Override
    public List<ForeignInvest> selectForeignInvestList(ForeignInvest foreignInvest)
    {
        return foreignInvestMapper.selectForeignInvestList(foreignInvest);
    }

    /**
     * 新增对外投资
     * 
     * @param foreignInvest 对外投资
     * @return 结果
     */
    @Override
    public int insertForeignInvest(ForeignInvest foreignInvest)
    {
        foreignInvest.setCreateTime(DateUtils.getNowDate());
        return foreignInvestMapper.insertForeignInvest(foreignInvest);
    }

    /**
     * 修改对外投资
     * 
     * @param foreignInvest 对外投资
     * @return 结果
     */
    @Override
    public int updateForeignInvest(ForeignInvest foreignInvest)
    {
        foreignInvest.setUpdateTime(DateUtils.getNowDate());
        return foreignInvestMapper.updateForeignInvest(foreignInvest);
    }

    /**
     * 批量删除对外投资
     * 
     * @param ids 需要删除的对外投资主键
     * @return 结果
     */
    @Override
    public int deleteForeignInvestByIds(String[] ids)
    {
        return foreignInvestMapper.deleteForeignInvestByIds(ids);
    }

    /**
     * 删除对外投资信息
     * 
     * @param id 对外投资主键
     * @return 结果
     */
    @Override
    public int deleteForeignInvestById(String id)
    {
        return foreignInvestMapper.deleteForeignInvestById(id);
    }
}
